[ykj_id].vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <div class="cjfx_pjflcfx">
  3. <NavHeader />
  4. <bread-crumb />
  5. <div class="w-1200px m-auto flex flex-row justify-between">
  6. <div class="w-188px">
  7. <leftSider :ykjId="ykjId" :activeIndex="activeIndex" @parentClick="parentClick"/>
  8. </div>
  9. <div class="w-1012px p-4 blueBg">
  10. <div class="flex items-center">
  11. <optionSelect @optionClick="optionClick" />
  12. </div>
  13. <div class="flex justify-between mt-4 exportBtn">
  14. <div>
  15. <el-button color="#003eee" type="primary" size="large" @click="exportBtn">导出</el-button>
  16. </div>
  17. </div>
  18. <div class="h-150 mt-20px overflow-x-auto echartData" id="echartData"></div>
  19. <div class="w-full h-auto tableList">
  20. <div class="h-50px rounded flex flex-nowrap tableList_title">
  21. <div class="singleT" v-for="(item,index) in classArr" :key="index">{{item}}</div>
  22. </div>
  23. <div class="h-auto flex flex-nowrap tableList_content" v-for="(item,index) in classBaseInfoArr" :key="index">
  24. <div class="h-60px rounded mt-2px singleTSec " :class="{'singleTSecDif':index%2==1}">{{ item.xx }}</div>
  25. <div class="h-60px rounded mt-2px singleTSec " :class="{'singleTSecDif':index%2==1}">{{ item.pjf }}</div>
  26. <div class="h-60px rounded mt-2px singleTSec " :class="{'singleTSecDif':index%2==1}">{{ item.zjf }}</div>
  27. <div class="h-60px rounded mt-2px singleTSec " :class="{'singleTSecDif':index%2==1}">{{ item.jflc }}</div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <commonFooter />
  33. </div>
  34. </template>
  35. <route lang="json">
  36. {
  37. "meta": {
  38. "title": "考试分析",
  39. "breadcrumb": true
  40. }
  41. }
  42. </route>
  43. <script lang="ts" setup>
  44. import * as echarts from 'echarts';
  45. import {cjfx_pjflcfx_list } from '../apiItem';
  46. const route = useRoute();
  47. import { user } from "~/store";
  48. const activeIndex =ref('1-4');
  49. const ykjId = ref();
  50. const parentClick = (val: string) => {
  51. activeIndex.value = val;
  52. ykjId.value = route.params.ykj_id;
  53. }
  54. let classArr = ref([]);
  55. let classBaseInfoArr = ref([
  56. {
  57. xx: "临沂市蒙阴县乡镇小学",
  58. pjf:12,
  59. zjf:12,
  60. jflc:1,
  61. },
  62. {
  63. xx: "临沂市蒙阴县乡镇小学",
  64. pjf:12,
  65. zjf:12,
  66. jflc:1,
  67. },
  68. {
  69. xx: "临沂市蒙阴县乡镇小学",
  70. pjf:12,
  71. zjf:12,
  72. jflc:1,
  73. },
  74. {
  75. xx: "临沂市蒙阴县乡镇小学",
  76. pjf:12,
  77. zjf:12,
  78. jflc:1,
  79. },
  80. ]);
  81. ykjId.value = route.params.ykj_id;
  82. onMounted(() => {
  83. initData();
  84. })
  85. const school_id = ref("");
  86. const grade_id = ref("");
  87. const xueke_id = ref("");
  88. const initData =() => {
  89. let transObj = {
  90. school_id:school_id.value,
  91. cm_id: grade_id.value,
  92. xueke_id: xueke_id.value,
  93. jh_id:route.params.ykj_id
  94. }
  95. cjfx_pjflcfx_list(transObj)
  96. .then(res => {
  97. if (res.code == "1") {
  98. classArr.value = res.data.data.classArr;
  99. classBaseInfoArr.value = res.data.data.classBaseInfoArr;
  100. initChart(res.data.data.ecahrtData)
  101. }
  102. })
  103. .catch(error=>{console.log(error)})
  104. }
  105. //option筛选
  106. const optionClick = (val: any, marke: any) => {
  107. if (marke == "scholl") {
  108. school_id.value = val;
  109. } else if (marke == "grade") {
  110. grade_id.value = val;
  111. } else {
  112. xueke_id.value = val;
  113. }
  114. initData();
  115. }
  116. const initChart = (item: { xAxis_data: any; series: any; }) => {
  117. const colors=['#9CFF68','#FE6868']
  118. var myChart = echarts.init(document.getElementById('echartData'));
  119. myChart.setOption({
  120. title: {
  121. text: '平均分',
  122. },
  123. tooltip: {
  124. trigger: 'axis',
  125. axisPointer: {
  126. type: 'shadow'
  127. }
  128. },
  129. grid: {
  130. left: '3%',
  131. right: '4%',
  132. bottom: '3%',
  133. containLabel: true
  134. },
  135. xAxis: [
  136. {
  137. type: 'category',
  138. axisTick: {
  139. show: false
  140. },
  141. data: item.xAxis_data
  142. }
  143. ],
  144. yAxis: [
  145. {
  146. type: 'value'
  147. }
  148. ],
  149. series: item.series,
  150. });
  151. }
  152. //导出
  153. const exportBtn = () => {
  154. let prefixedUrl = window.GLOBAL_CONFIG.web_pc;
  155. let fullUrl = prefixedUrl + '/openapi/echart/average_data.php?api=xls&token=' + user.value.token;
  156. window.open(fullUrl,'_blank')
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. :deep(.el-sub-menu__title) {
  161. background: #003eee;
  162. color: #fff;
  163. }
  164. :deep(.el-table__header thead tr th) {
  165. background: #003eee !important;
  166. color: #fff;
  167. height: 50px;
  168. line-height: 50px;
  169. font-weight: normal;
  170. }
  171. :deep(.el-table__header thead tr th:first-child) {
  172. border-top-left-radius: 9px;
  173. }
  174. :deep(.el-table__body tbody .el-table__row td) {
  175. background-color: transparent;
  176. }
  177. :deep(.el-dialog__footer) {
  178. text-align: center;
  179. }
  180. .blueBg {
  181. background: #F1F7FF;
  182. }
  183. .whiteBG {
  184. background: #fff;
  185. }
  186. .singlepart {
  187. background-color: rgba($color: #ffffff, $alpha: 0.2);
  188. color: #fff;
  189. }
  190. .tableList {
  191. overflow-x: scroll;
  192. }
  193. .tableList_title {
  194. font-size: 14px;
  195. color: #fff;
  196. }
  197. .singleT {
  198. flex: 1;
  199. font-size: 14px;
  200. line-height: 50px;
  201. width: fit-content;
  202. text-align: center;
  203. background: #003eee;
  204. }
  205. .singleT:first-child{
  206. border-top-left-radius: 5px;
  207. }
  208. .singleT:last-child{
  209. border-top-right-radius: 5px;
  210. }
  211. .singleD {
  212. flex: 1;
  213. }
  214. .singleTSec {
  215. width: fit-content;
  216. flex: 1;
  217. line-height: 60px;
  218. text-align: center;
  219. }
  220. .singleTSecDif{
  221. background-color: #fff;
  222. }
  223. </style>